package com.xwaf.platform.system.auth.task.data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 
 * <p>
 * 全局导入池
 * <p>
 * 
 * @author 李聪 <br>
 * @email xwaf_love@yeah.net <br>
 * @since JDK 1.8<br>
 * @date 2020年1月4日 下午1:18:01 <br>
 * @see 无<br>
 *      Copyright (c) 2020, xwaf_love@yeah.net All Rights Reserved.<br>
 */
public class Pool {

	private static Map<String, List<ImportData>> companyDatas = new ConcurrentHashMap<String, List<ImportData>>();

	public synchronized static List<ImportData> get(String companyId) {
		if (companyDatas.get(companyId) == null) {
			companyDatas.put(companyId, Collections.synchronizedList(new ArrayList<ImportData>()));
		}
		return companyDatas.get(companyId);
	}

	public static boolean containsKey(Long companyId) {
		return companyDatas.containsKey(companyId);
	}

	public static Set<String> keySet() {
		return companyDatas.keySet();
	}
}
